import requests


# 使用json方法
# url = 'http://httpbin.org/get'
# res = requests.get(url)
# print(res.json())

# 使用text方法
# url = 'https://www.baidu.com/robots.txt'
# res = requests.get(url)
# print(res.text)

# 使用content方法 文本字节流
# url = 'https://www.baidu.com'
# res = requests.get(url)
# data = res.content
# print(data.decode('utf-8'))

# 使用content 方法 图片字节流
url = "https://imgxz.bizhi3.com/20230818/230818022449185.jpg"
res = requests.get(url)
data = res.content
with open('a.img.jpg', 'wb') as f:
    f.write(data)





